from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.
from apps.demo.models import User


def app1(request):
    return HttpResponse("我是app中的视图")

def select_user(request):
    print('忽略大小写匹配', User.objects.filter(name__iexact='PYTHON'))
    print('包含', User.objects.filter(name__contains='t'))
    print('以什么开始', User.objects.filter(name__startswith='p'))
    print('以什么结束', User.objects.filter(name__endswith='n'))
    print('大于', User.objects.filter(id__gt=1))
    print('大于等于', User.objects.filter(id__gte=1))
    print('小于', User.objects.filter(id__lt=1))
    print('小于等于', User.objects.filter(id__lte=1))
    print('区间', User.objects.filter(id__range=(1,2)))
    print('判断是否为空', User.objects.filter(name__isnull=False))
    print('成员', User.objects.filter(name__in=['python','java']))
    return HttpResponse("查询成功")